{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 加载数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "boys_grades = pd.read_excel('./18级高一体测成绩汇总.xls')\n",
    "girls_grades = pd.read_excel('./18级高一体测成绩汇总.xls',sheet_name=1)\n",
    "standard = pd.read_excel('./体侧成绩评分表.xls',header=[0,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'13</td>\n",
       "      <td>8.88</td>\n",
       "      <td>195.0</td>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>2785</td>\n",
       "      <td>170.0</td>\n",
       "      <td>72.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'16</td>\n",
       "      <td>7.70</td>\n",
       "      <td>225.0</td>\n",
       "      <td>11</td>\n",
       "      <td>7</td>\n",
       "      <td>3133</td>\n",
       "      <td>174.0</td>\n",
       "      <td>52.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'09</td>\n",
       "      <td>8.45</td>\n",
       "      <td>218.0</td>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>3901</td>\n",
       "      <td>169.0</td>\n",
       "      <td>46.5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4'21</td>\n",
       "      <td>8.05</td>\n",
       "      <td>206.0</td>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>4946</td>\n",
       "      <td>183.0</td>\n",
       "      <td>79.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3'44</td>\n",
       "      <td>7.52</td>\n",
       "      <td>210.0</td>\n",
       "      <td>13</td>\n",
       "      <td>9</td>\n",
       "      <td>3538</td>\n",
       "      <td>171.0</td>\n",
       "      <td>54.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>472</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4'23</td>\n",
       "      <td>8.27</td>\n",
       "      <td>208.0</td>\n",
       "      <td>10</td>\n",
       "      <td>0</td>\n",
       "      <td>4647</td>\n",
       "      <td>176.0</td>\n",
       "      <td>69.5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>473</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5'19</td>\n",
       "      <td>9.55</td>\n",
       "      <td>210.0</td>\n",
       "      <td>15</td>\n",
       "      <td>6</td>\n",
       "      <td>7042</td>\n",
       "      <td>177.0</td>\n",
       "      <td>76.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>474</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3'25</td>\n",
       "      <td>7.50</td>\n",
       "      <td>252.0</td>\n",
       "      <td>13</td>\n",
       "      <td>13</td>\n",
       "      <td>5755</td>\n",
       "      <td>181.0</td>\n",
       "      <td>65.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>475</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4'39</td>\n",
       "      <td>7.81</td>\n",
       "      <td>208.0</td>\n",
       "      <td>14</td>\n",
       "      <td>11</td>\n",
       "      <td>5688</td>\n",
       "      <td>172.0</td>\n",
       "      <td>51.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>476</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>477 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别 男1000米跑  男50米跑    男跳远  男体前屈  男引体  男肺活量     身高    体重  BMI\n",
       "0     1  男    4'13   8.88  195.0    12    1  2785  170.0  72.6    0\n",
       "1     1  男    4'16   7.70  225.0    11    7  3133  174.0  52.7    0\n",
       "2     1  男    4'09   8.45  218.0    14    1  3901  169.0  46.5    0\n",
       "3     1  男    4'21   8.05  206.0    13    1  4946  183.0  79.7    0\n",
       "4     1  男    3'44   7.52  210.0    13    9  3538  171.0  54.7    0\n",
       "..   .. ..     ...    ...    ...   ...  ...   ...    ...   ...  ...\n",
       "472  17  男    4'23   8.27  208.0    10    0  4647  176.0  69.5    0\n",
       "473  17  男    5'19   9.55  210.0    15    6  7042  177.0  76.0    0\n",
       "474  17  男    3'25   7.50  252.0    13   13  5755  181.0  65.0    0\n",
       "475  17  男    4'39   7.81  208.0    14   11  5688  172.0  51.7    0\n",
       "476  17  男       0   0.00    0.0     0    0     0    0.0   0.0    0\n",
       "\n",
       "[477 rows x 11 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boys_grades"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>9.32</td>\n",
       "      <td>185.0</td>\n",
       "      <td>16</td>\n",
       "      <td>48</td>\n",
       "      <td>3775</td>\n",
       "      <td>163.0</td>\n",
       "      <td>51.3</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>11.44</td>\n",
       "      <td>148.0</td>\n",
       "      <td>9</td>\n",
       "      <td>29</td>\n",
       "      <td>3683</td>\n",
       "      <td>163.0</td>\n",
       "      <td>66.6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>13.40</td>\n",
       "      <td>150.0</td>\n",
       "      <td>7</td>\n",
       "      <td>40</td>\n",
       "      <td>3331</td>\n",
       "      <td>157.0</td>\n",
       "      <td>60.0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>9.52</td>\n",
       "      <td>172.0</td>\n",
       "      <td>21</td>\n",
       "      <td>46</td>\n",
       "      <td>3701</td>\n",
       "      <td>160.0</td>\n",
       "      <td>50.7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>9.79</td>\n",
       "      <td>145.0</td>\n",
       "      <td>8</td>\n",
       "      <td>34</td>\n",
       "      <td>3592</td>\n",
       "      <td>167.0</td>\n",
       "      <td>63.9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   班级 性别  女800米跑  女50米跑    女跳远  女体前屈  女仰卧  女肺活量     身高    体重  BMI\n",
       "0   1  女    3.22   9.32  185.0    16   48  3775  163.0  51.3    0\n",
       "1   1  女    4.59  11.44  148.0     9   29  3683  163.0  66.6    0\n",
       "2   1  女    3.46  13.40  150.0     7   40  3331  157.0  60.0    0\n",
       "3   1  女    3.39   9.52  172.0    21   46  3701  160.0  50.7    0\n",
       "4   1  女    3.43   9.79  145.0     8   34  3592  167.0  63.9    0"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "girls_grades.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">男肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男体前屈</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女跳远</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男引体</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女仰卧</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男1000米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女800米跑</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>...</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>100</td>\n",
       "      <td>3'24\"</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3'35\"</td>\n",
       "      <td>95</td>\n",
       "      <td>3'30\"</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3'40\"</td>\n",
       "      <td>90</td>\n",
       "      <td>3'36\"</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3'47\"</td>\n",
       "      <td>85</td>\n",
       "      <td>3'43\"</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>80</td>\n",
       "      <td>3'50\"</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>3680</td>\n",
       "      <td>78</td>\n",
       "      <td>2650</td>\n",
       "      <td>78</td>\n",
       "      <td>7.7</td>\n",
       "      <td>78</td>\n",
       "      <td>8.8</td>\n",
       "      <td>78</td>\n",
       "      <td>13.6</td>\n",
       "      <td>78</td>\n",
       "      <td>...</td>\n",
       "      <td>175</td>\n",
       "      <td>78</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>4'00\"</td>\n",
       "      <td>78</td>\n",
       "      <td>3'55\"</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>3560</td>\n",
       "      <td>76</td>\n",
       "      <td>2550</td>\n",
       "      <td>76</td>\n",
       "      <td>7.9</td>\n",
       "      <td>76</td>\n",
       "      <td>9.0</td>\n",
       "      <td>76</td>\n",
       "      <td>12.2</td>\n",
       "      <td>76</td>\n",
       "      <td>...</td>\n",
       "      <td>172</td>\n",
       "      <td>76</td>\n",
       "      <td>11.0</td>\n",
       "      <td>76</td>\n",
       "      <td>39</td>\n",
       "      <td>76</td>\n",
       "      <td>4'05\"</td>\n",
       "      <td>76</td>\n",
       "      <td>4'00\"</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>3440</td>\n",
       "      <td>74</td>\n",
       "      <td>2450</td>\n",
       "      <td>74</td>\n",
       "      <td>8.1</td>\n",
       "      <td>74</td>\n",
       "      <td>9.2</td>\n",
       "      <td>74</td>\n",
       "      <td>10.8</td>\n",
       "      <td>74</td>\n",
       "      <td>...</td>\n",
       "      <td>169</td>\n",
       "      <td>74</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74</td>\n",
       "      <td>37</td>\n",
       "      <td>74</td>\n",
       "      <td>4'10\"</td>\n",
       "      <td>74</td>\n",
       "      <td>4'05\"</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>3320</td>\n",
       "      <td>72</td>\n",
       "      <td>2350</td>\n",
       "      <td>72</td>\n",
       "      <td>8.3</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72</td>\n",
       "      <td>9.4</td>\n",
       "      <td>72</td>\n",
       "      <td>...</td>\n",
       "      <td>166</td>\n",
       "      <td>72</td>\n",
       "      <td>10.0</td>\n",
       "      <td>72</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>4'15\"</td>\n",
       "      <td>72</td>\n",
       "      <td>4'10\"</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>3200</td>\n",
       "      <td>70</td>\n",
       "      <td>2250</td>\n",
       "      <td>70</td>\n",
       "      <td>8.5</td>\n",
       "      <td>70</td>\n",
       "      <td>9.6</td>\n",
       "      <td>70</td>\n",
       "      <td>8.0</td>\n",
       "      <td>70</td>\n",
       "      <td>...</td>\n",
       "      <td>163</td>\n",
       "      <td>70</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70</td>\n",
       "      <td>33</td>\n",
       "      <td>70</td>\n",
       "      <td>4'20\"</td>\n",
       "      <td>70</td>\n",
       "      <td>4'15\"</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>10</td>\n",
       "      <td>3080</td>\n",
       "      <td>68</td>\n",
       "      <td>2150</td>\n",
       "      <td>68</td>\n",
       "      <td>8.7</td>\n",
       "      <td>68</td>\n",
       "      <td>9.8</td>\n",
       "      <td>68</td>\n",
       "      <td>6.6</td>\n",
       "      <td>68</td>\n",
       "      <td>...</td>\n",
       "      <td>160</td>\n",
       "      <td>68</td>\n",
       "      <td>9.0</td>\n",
       "      <td>68</td>\n",
       "      <td>31</td>\n",
       "      <td>68</td>\n",
       "      <td>4'25\"</td>\n",
       "      <td>68</td>\n",
       "      <td>4'20\"</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>11</td>\n",
       "      <td>2960</td>\n",
       "      <td>66</td>\n",
       "      <td>2050</td>\n",
       "      <td>66</td>\n",
       "      <td>8.9</td>\n",
       "      <td>66</td>\n",
       "      <td>10.0</td>\n",
       "      <td>66</td>\n",
       "      <td>5.2</td>\n",
       "      <td>66</td>\n",
       "      <td>...</td>\n",
       "      <td>157</td>\n",
       "      <td>66</td>\n",
       "      <td>NaN</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>66</td>\n",
       "      <td>4'30\"</td>\n",
       "      <td>66</td>\n",
       "      <td>4'25\"</td>\n",
       "      <td>66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>12</td>\n",
       "      <td>2840</td>\n",
       "      <td>64</td>\n",
       "      <td>1950</td>\n",
       "      <td>64</td>\n",
       "      <td>9.1</td>\n",
       "      <td>64</td>\n",
       "      <td>10.2</td>\n",
       "      <td>64</td>\n",
       "      <td>3.8</td>\n",
       "      <td>64</td>\n",
       "      <td>...</td>\n",
       "      <td>154</td>\n",
       "      <td>64</td>\n",
       "      <td>8.0</td>\n",
       "      <td>64</td>\n",
       "      <td>27</td>\n",
       "      <td>64</td>\n",
       "      <td>4'35\"</td>\n",
       "      <td>64</td>\n",
       "      <td>4'30\"</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>13</td>\n",
       "      <td>2720</td>\n",
       "      <td>62</td>\n",
       "      <td>1850</td>\n",
       "      <td>62</td>\n",
       "      <td>9.3</td>\n",
       "      <td>62</td>\n",
       "      <td>10.4</td>\n",
       "      <td>62</td>\n",
       "      <td>2.4</td>\n",
       "      <td>62</td>\n",
       "      <td>...</td>\n",
       "      <td>151</td>\n",
       "      <td>62</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62</td>\n",
       "      <td>25</td>\n",
       "      <td>62</td>\n",
       "      <td>4'40\"</td>\n",
       "      <td>62</td>\n",
       "      <td>4'35\"</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>14</td>\n",
       "      <td>2600</td>\n",
       "      <td>60</td>\n",
       "      <td>1750</td>\n",
       "      <td>60</td>\n",
       "      <td>9.5</td>\n",
       "      <td>60</td>\n",
       "      <td>10.6</td>\n",
       "      <td>60</td>\n",
       "      <td>1.0</td>\n",
       "      <td>60</td>\n",
       "      <td>...</td>\n",
       "      <td>148</td>\n",
       "      <td>60</td>\n",
       "      <td>7.0</td>\n",
       "      <td>60</td>\n",
       "      <td>23</td>\n",
       "      <td>60</td>\n",
       "      <td>4'45\"</td>\n",
       "      <td>60</td>\n",
       "      <td>4'40\"</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>15</td>\n",
       "      <td>2470</td>\n",
       "      <td>50</td>\n",
       "      <td>1710</td>\n",
       "      <td>50</td>\n",
       "      <td>9.7</td>\n",
       "      <td>50</td>\n",
       "      <td>10.8</td>\n",
       "      <td>50</td>\n",
       "      <td>0.0</td>\n",
       "      <td>50</td>\n",
       "      <td>...</td>\n",
       "      <td>143</td>\n",
       "      <td>50</td>\n",
       "      <td>6.0</td>\n",
       "      <td>50</td>\n",
       "      <td>21</td>\n",
       "      <td>50</td>\n",
       "      <td>5'05\"</td>\n",
       "      <td>50</td>\n",
       "      <td>4'50\"</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>16</td>\n",
       "      <td>2340</td>\n",
       "      <td>40</td>\n",
       "      <td>1670</td>\n",
       "      <td>40</td>\n",
       "      <td>9.9</td>\n",
       "      <td>40</td>\n",
       "      <td>11.0</td>\n",
       "      <td>40</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>40</td>\n",
       "      <td>...</td>\n",
       "      <td>138</td>\n",
       "      <td>40</td>\n",
       "      <td>5.0</td>\n",
       "      <td>40</td>\n",
       "      <td>19</td>\n",
       "      <td>40</td>\n",
       "      <td>5'25\"</td>\n",
       "      <td>40</td>\n",
       "      <td>5'00\"</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>17</td>\n",
       "      <td>2210</td>\n",
       "      <td>30</td>\n",
       "      <td>1630</td>\n",
       "      <td>30</td>\n",
       "      <td>10.1</td>\n",
       "      <td>30</td>\n",
       "      <td>11.2</td>\n",
       "      <td>30</td>\n",
       "      <td>-2.0</td>\n",
       "      <td>30</td>\n",
       "      <td>...</td>\n",
       "      <td>133</td>\n",
       "      <td>30</td>\n",
       "      <td>4.0</td>\n",
       "      <td>30</td>\n",
       "      <td>17</td>\n",
       "      <td>30</td>\n",
       "      <td>5'45\"</td>\n",
       "      <td>30</td>\n",
       "      <td>5'10\"</td>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>18</td>\n",
       "      <td>2080</td>\n",
       "      <td>20</td>\n",
       "      <td>1590</td>\n",
       "      <td>20</td>\n",
       "      <td>10.3</td>\n",
       "      <td>20</td>\n",
       "      <td>11.4</td>\n",
       "      <td>20</td>\n",
       "      <td>-3.0</td>\n",
       "      <td>20</td>\n",
       "      <td>...</td>\n",
       "      <td>128</td>\n",
       "      <td>20</td>\n",
       "      <td>3.0</td>\n",
       "      <td>20</td>\n",
       "      <td>15</td>\n",
       "      <td>20</td>\n",
       "      <td>6'05\"</td>\n",
       "      <td>20</td>\n",
       "      <td>5'20\"</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>19</td>\n",
       "      <td>1950</td>\n",
       "      <td>10</td>\n",
       "      <td>1550</td>\n",
       "      <td>10</td>\n",
       "      <td>10.5</td>\n",
       "      <td>10</td>\n",
       "      <td>11.6</td>\n",
       "      <td>10</td>\n",
       "      <td>-4.0</td>\n",
       "      <td>10</td>\n",
       "      <td>...</td>\n",
       "      <td>123</td>\n",
       "      <td>10</td>\n",
       "      <td>2.0</td>\n",
       "      <td>10</td>\n",
       "      <td>13</td>\n",
       "      <td>10</td>\n",
       "      <td>6'25\"</td>\n",
       "      <td>10</td>\n",
       "      <td>5'30\"</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>20 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    男肺活量       女肺活量      男50米跑      女50米跑       男体前屈       ...  女跳远       \\\n",
       "      成绩   分数    成绩   分数    成绩   分数    成绩   分数    成绩   分数  ...   成绩   分数   \n",
       "0   4540  100  3150  100   7.1  100   7.8  100  23.6  100  ...  204  100   \n",
       "1   4420   95  3100   95   7.2   95   7.9   95  21.5   95  ...  198   95   \n",
       "2   4300   90  3050   90   7.3   90   8.0   90  19.4   90  ...  192   90   \n",
       "3   4050   85  2900   85   7.4   85   8.3   85  17.2   85  ...  185   85   \n",
       "4   3800   80  2750   80   7.5   80   8.6   80  15.0   80  ...  178   80   \n",
       "5   3680   78  2650   78   7.7   78   8.8   78  13.6   78  ...  175   78   \n",
       "6   3560   76  2550   76   7.9   76   9.0   76  12.2   76  ...  172   76   \n",
       "7   3440   74  2450   74   8.1   74   9.2   74  10.8   74  ...  169   74   \n",
       "8   3320   72  2350   72   8.3   72   9.4   72   9.4   72  ...  166   72   \n",
       "9   3200   70  2250   70   8.5   70   9.6   70   8.0   70  ...  163   70   \n",
       "10  3080   68  2150   68   8.7   68   9.8   68   6.6   68  ...  160   68   \n",
       "11  2960   66  2050   66   8.9   66  10.0   66   5.2   66  ...  157   66   \n",
       "12  2840   64  1950   64   9.1   64  10.2   64   3.8   64  ...  154   64   \n",
       "13  2720   62  1850   62   9.3   62  10.4   62   2.4   62  ...  151   62   \n",
       "14  2600   60  1750   60   9.5   60  10.6   60   1.0   60  ...  148   60   \n",
       "15  2470   50  1710   50   9.7   50  10.8   50   0.0   50  ...  143   50   \n",
       "16  2340   40  1670   40   9.9   40  11.0   40  -1.0   40  ...  138   40   \n",
       "17  2210   30  1630   30  10.1   30  11.2   30  -2.0   30  ...  133   30   \n",
       "18  2080   20  1590   20  10.3   20  11.4   20  -3.0   20  ...  128   20   \n",
       "19  1950   10  1550   10  10.5   10  11.6   10  -4.0   10  ...  123   10   \n",
       "\n",
       "     男引体      女仰卧      男1000米跑      女800米跑       \n",
       "      成绩   分数  成绩   分数      成绩   分数     成绩   分数  \n",
       "0   16.0  100  53  100   3'30\"  100  3'24\"  100  \n",
       "1   15.0   95  51   95   3'35\"   95  3'30\"   95  \n",
       "2   14.0   90  49   90   3'40\"   90  3'36\"   90  \n",
       "3   13.0   85  46   85   3'47\"   85  3'43\"   85  \n",
       "4   12.0   80  43   80   3'55\"   80  3'50\"   80  \n",
       "5    NaN   78  41   78   4'00\"   78  3'55\"   78  \n",
       "6   11.0   76  39   76   4'05\"   76  4'00\"   76  \n",
       "7    NaN   74  37   74   4'10\"   74  4'05\"   74  \n",
       "8   10.0   72  35   72   4'15\"   72  4'10\"   72  \n",
       "9    NaN   70  33   70   4'20\"   70  4'15\"   70  \n",
       "10   9.0   68  31   68   4'25\"   68  4'20\"   68  \n",
       "11   NaN   66  29   66   4'30\"   66  4'25\"   66  \n",
       "12   8.0   64  27   64   4'35\"   64  4'30\"   64  \n",
       "13   NaN   62  25   62   4'40\"   62  4'35\"   62  \n",
       "14   7.0   60  23   60   4'45\"   60  4'40\"   60  \n",
       "15   6.0   50  21   50   5'05\"   50  4'50\"   50  \n",
       "16   5.0   40  19   40   5'25\"   40  5'00\"   40  \n",
       "17   4.0   30  17   30   5'45\"   30  5'10\"   30  \n",
       "18   3.0   20  15   20   6'05\"   20  5'20\"   20  \n",
       "19   2.0   10  13   10   6'25\"   10  5'30\"   10  \n",
       "\n",
       "[20 rows x 24 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "standard"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据类型转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def f(time_string):\n",
    "    if isinstance(time_string,str):\n",
    "        splitter = \"'\"\n",
    "        mins, secs = time_string.split(\"'\")\n",
    "        mins, secs=int(mins),int(secs)\n",
    "        return mins+secs/100.0\n",
    "    else:\n",
    "        return(time_string)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "boys_grades['男1000米跑']=boys_grades['男1000米跑'].map(f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      4.13\n",
       "1      4.16\n",
       "2      4.09\n",
       "3      4.21\n",
       "4      3.44\n",
       "       ... \n",
       "472    4.23\n",
       "473    5.19\n",
       "474    3.25\n",
       "475    4.39\n",
       "476    0.00\n",
       "Name: 男1000米跑, Length: 477, dtype: float64"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boys_grades['男1000米跑']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def convert1(x):\n",
    "    if isinstance(x,str):\n",
    "        m,s=x.split(\"'\")\n",
    "        s,s1=s.split('\"')\n",
    "        m,s=int(m),int(s)\n",
    "        return m+s/100.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "standard[('男1000米跑','成绩')]=standard[('男1000米跑','成绩')].transform(convert1)\n",
    "standard[('女800米跑','成绩')]=standard[('女800米跑','成绩')].transform(convert1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">男肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女肺活量</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女50米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男体前屈</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女跳远</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男引体</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女仰卧</th>\n",
       "      <th colspan=\"2\" halign=\"left\">男1000米跑</th>\n",
       "      <th colspan=\"2\" halign=\"left\">女800米跑</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>...</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "      <th>成绩</th>\n",
       "      <th>分数</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>4540</td>\n",
       "      <td>100</td>\n",
       "      <td>3150</td>\n",
       "      <td>100</td>\n",
       "      <td>7.1</td>\n",
       "      <td>100</td>\n",
       "      <td>7.8</td>\n",
       "      <td>100</td>\n",
       "      <td>23.6</td>\n",
       "      <td>100</td>\n",
       "      <td>...</td>\n",
       "      <td>204</td>\n",
       "      <td>100</td>\n",
       "      <td>16.0</td>\n",
       "      <td>100</td>\n",
       "      <td>53</td>\n",
       "      <td>100</td>\n",
       "      <td>3.30</td>\n",
       "      <td>100</td>\n",
       "      <td>3.24</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>4420</td>\n",
       "      <td>95</td>\n",
       "      <td>3100</td>\n",
       "      <td>95</td>\n",
       "      <td>7.2</td>\n",
       "      <td>95</td>\n",
       "      <td>7.9</td>\n",
       "      <td>95</td>\n",
       "      <td>21.5</td>\n",
       "      <td>95</td>\n",
       "      <td>...</td>\n",
       "      <td>198</td>\n",
       "      <td>95</td>\n",
       "      <td>15.0</td>\n",
       "      <td>95</td>\n",
       "      <td>51</td>\n",
       "      <td>95</td>\n",
       "      <td>3.35</td>\n",
       "      <td>95</td>\n",
       "      <td>3.30</td>\n",
       "      <td>95</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>4300</td>\n",
       "      <td>90</td>\n",
       "      <td>3050</td>\n",
       "      <td>90</td>\n",
       "      <td>7.3</td>\n",
       "      <td>90</td>\n",
       "      <td>8.0</td>\n",
       "      <td>90</td>\n",
       "      <td>19.4</td>\n",
       "      <td>90</td>\n",
       "      <td>...</td>\n",
       "      <td>192</td>\n",
       "      <td>90</td>\n",
       "      <td>14.0</td>\n",
       "      <td>90</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>3.40</td>\n",
       "      <td>90</td>\n",
       "      <td>3.36</td>\n",
       "      <td>90</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>4050</td>\n",
       "      <td>85</td>\n",
       "      <td>2900</td>\n",
       "      <td>85</td>\n",
       "      <td>7.4</td>\n",
       "      <td>85</td>\n",
       "      <td>8.3</td>\n",
       "      <td>85</td>\n",
       "      <td>17.2</td>\n",
       "      <td>85</td>\n",
       "      <td>...</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>13.0</td>\n",
       "      <td>85</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3.47</td>\n",
       "      <td>85</td>\n",
       "      <td>3.43</td>\n",
       "      <td>85</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>3800</td>\n",
       "      <td>80</td>\n",
       "      <td>2750</td>\n",
       "      <td>80</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>8.6</td>\n",
       "      <td>80</td>\n",
       "      <td>15.0</td>\n",
       "      <td>80</td>\n",
       "      <td>...</td>\n",
       "      <td>178</td>\n",
       "      <td>80</td>\n",
       "      <td>12.0</td>\n",
       "      <td>80</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3.55</td>\n",
       "      <td>80</td>\n",
       "      <td>3.50</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   男肺活量       女肺活量      男50米跑      女50米跑       男体前屈       ...  女跳远        男引体  \\\n",
       "     成绩   分数    成绩   分数    成绩   分数    成绩   分数    成绩   分数  ...   成绩   分数    成绩   \n",
       "0  4540  100  3150  100   7.1  100   7.8  100  23.6  100  ...  204  100  16.0   \n",
       "1  4420   95  3100   95   7.2   95   7.9   95  21.5   95  ...  198   95  15.0   \n",
       "2  4300   90  3050   90   7.3   90   8.0   90  19.4   90  ...  192   90  14.0   \n",
       "3  4050   85  2900   85   7.4   85   8.3   85  17.2   85  ...  185   85  13.0   \n",
       "4  3800   80  2750   80   7.5   80   8.6   80  15.0   80  ...  178   80  12.0   \n",
       "\n",
       "       女仰卧      男1000米跑      女800米跑       \n",
       "    分数  成绩   分数      成绩   分数     成绩   分数  \n",
       "0  100  53  100    3.30  100   3.24  100  \n",
       "1   95  51   95    3.35   95   3.30   95  \n",
       "2   90  49   90    3.40   90   3.36   90  \n",
       "3   85  46   85    3.47   85   3.43   85  \n",
       "4   80  43   80    3.55   80   3.50   80  \n",
       "\n",
       "[5 rows x 24 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "standard.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 20 entries, 0 to 19\n",
      "Data columns (total 24 columns):\n",
      "(男肺活量, 成绩)       20 non-null int64\n",
      "(男肺活量, 分数)       20 non-null int64\n",
      "(女肺活量, 成绩)       20 non-null int64\n",
      "(女肺活量, 分数)       20 non-null int64\n",
      "(男50米跑, 成绩)      20 non-null float64\n",
      "(男50米跑, 分数)      20 non-null int64\n",
      "(女50米跑, 成绩)      20 non-null float64\n",
      "(女50米跑, 分数)      20 non-null int64\n",
      "(男体前屈, 成绩)       20 non-null float64\n",
      "(男体前屈, 分数)       20 non-null int64\n",
      "(女体前屈, 成绩)       20 non-null float64\n",
      "(女体前屈, 分数)       20 non-null int64\n",
      "(男跳远, 成绩)        20 non-null int64\n",
      "(男跳远, 分数)        20 non-null int64\n",
      "(女跳远, 成绩)        20 non-null int64\n",
      "(女跳远, 分数)        20 non-null int64\n",
      "(男引体, 成绩)        15 non-null float64\n",
      "(男引体, 分数)        20 non-null int64\n",
      "(女仰卧, 成绩)        20 non-null int64\n",
      "(女仰卧, 分数)        20 non-null int64\n",
      "(男1000米跑, 成绩)    20 non-null float64\n",
      "(男1000米跑, 分数)    20 non-null int64\n",
      "(女800米跑, 成绩)     20 non-null float64\n",
      "(女800米跑, 分数)     20 non-null int64\n",
      "dtypes: float64(7), int64(17)\n",
      "memory usage: 3.9 KB\n"
     ]
    }
   ],
   "source": [
    "standard.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "#将男生体测成绩数据转为float型\n",
    "boys_grades.iloc[:,3:]=boys_grades.iloc[:,3:].astype('float')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 477 entries, 0 to 476\n",
      "Data columns (total 11 columns):\n",
      "班级         477 non-null int64\n",
      "性别         477 non-null object\n",
      "男1000米跑    477 non-null float64\n",
      "男50米跑      477 non-null float64\n",
      "男跳远        477 non-null float64\n",
      "男体前屈       477 non-null float64\n",
      "男引体        477 non-null float64\n",
      "男肺活量       477 non-null float64\n",
      "身高         477 non-null float64\n",
      "体重         477 non-null float64\n",
      "BMI        477 non-null float64\n",
      "dtypes: float64(9), int64(1), object(1)\n",
      "memory usage: 41.1+ KB\n"
     ]
    }
   ],
   "source": [
    "boys_grades.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "#将女生体测成绩数据转为float型\n",
    "girls_grades.iloc[:,3:]=girls_grades.iloc[:,3:].astype('float')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 593 entries, 0 to 592\n",
      "Data columns (total 11 columns):\n",
      "班级        593 non-null int64\n",
      "性别        593 non-null object\n",
      "女800米跑    593 non-null float64\n",
      "女50米跑     593 non-null float64\n",
      "女跳远       593 non-null float64\n",
      "女体前屈      593 non-null float64\n",
      "女仰卧       593 non-null float64\n",
      "女肺活量      593 non-null float64\n",
      "身高        593 non-null float64\n",
      "体重        593 non-null float64\n",
      "BMI       593 non-null float64\n",
      "dtypes: float64(9), int64(1), object(1)\n",
      "memory usage: 51.1+ KB\n"
     ]
    }
   ],
   "source": [
    "girls_grades.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 计算成绩"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 男生体测成绩分数计算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py:205: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  self._setitem_with_indexer(indexer, value)\n"
     ]
    }
   ],
   "source": [
    "boys_grades['男1000米跑分数']=np.NaN\n",
    "for i in range(len(boys_grades)):\n",
    "    if boys_grades['男1000米跑'][i] <= 0 * standard[('男1000米跑','成绩')].iloc[0]:\n",
    "        boys_grades['男1000米跑分数'].iloc[i] = 0\n",
    "    elif boys_grades['男1000米跑'][i]<=standard[('男1000米跑','成绩')].iloc[0]:\n",
    "        boys_grades['男1000米跑分数'].iloc[i]=100\n",
    "    elif boys_grades['男1000米跑'][i]>=standard[('男1000米跑','成绩')].iloc[19]:\n",
    "        boys_grades['男1000米跑分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if boys_grades['男1000米跑'][i]<=standard[('男1000米跑','成绩')].iloc[j]:\n",
    "                boys_grades['男1000米跑分数'].iloc[i]=standard[('男1000米跑','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "#男50米跑\n",
    "boys_grades['男50米跑分数']=np.NaN\n",
    "for i in range(len(boys_grades)):\n",
    "    if boys_grades['男50米跑'][i] <= 0 * standard[('男50米跑','成绩')].iloc[0]:\n",
    "        boys_grades['男50米跑分数'].iloc[i] = 0\n",
    "    elif boys_grades['男50米跑'][i]<=standard[('男50米跑','成绩')].iloc[0]:\n",
    "        boys_grades['男50米跑分数'].iloc[i]=100\n",
    "    elif boys_grades['男50米跑'][i]>=standard[('男50米跑','成绩')].iloc[19]:\n",
    "        boys_grades['男50米跑分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if boys_grades['男50米跑'][i]<=standard[('男50米跑','成绩')].iloc[j]:\n",
    "                boys_grades['男50米跑分数'].iloc[i]=standard[('男50米跑','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "#男跳远\n",
    "boys_grades['男跳远分数']=np.NaN\n",
    "for i in range(len(boys_grades)):\n",
    "    if boys_grades['男跳远'][i]>=standard[('男跳远','成绩')].iloc[0]:\n",
    "        boys_grades['男跳远分数'].iloc[i]=100\n",
    "    elif boys_grades['男跳远'][i]<=standard[('男跳远','成绩')].iloc[19]:\n",
    "        boys_grades['男跳远分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if boys_grades['男跳远'][i] >= standard[('男跳远','成绩')].iloc[j]:\n",
    "                boys_grades['男跳远分数'].iloc[i]=standard[('男跳远','分数')].iloc[j]\n",
    "                break\n",
    "            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "#男体前屈\n",
    "boys_grades['男体前屈分数']=np.NaN\n",
    "for i in range(len(boys_grades)):\n",
    "    if boys_grades['男体前屈'][i]>=standard[('男体前屈','成绩')].iloc[0]:\n",
    "        boys_grades['男体前屈分数'].iloc[i]=100\n",
    "    elif boys_grades['男体前屈'][i]<=standard[('男体前屈','成绩')].iloc[19]:\n",
    "        boys_grades['男体前屈分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if boys_grades['男体前屈'][i] >= standard[('男体前屈','成绩')].iloc[j]:\n",
    "                boys_grades['男体前屈分数'].iloc[i]=standard[('男体前屈','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "#男引体\n",
    "boys_grades['男引体分数']=np.NaN\n",
    "for i in range(len(boys_grades)):\n",
    "    if boys_grades['男引体'][i]>=standard[('男引体','成绩')].iloc[0]:\n",
    "        boys_grades['男引体分数'].iloc[i]=100\n",
    "    elif boys_grades['男引体'][i]<=standard[('男引体','成绩')].iloc[19]:\n",
    "        boys_grades['男引体分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if boys_grades['男引体'][i] >= standard[('男引体','成绩')].iloc[j]:\n",
    "                boys_grades['男引体分数'].iloc[i]=standard[('男引体','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "#男肺活量\n",
    "boys_grades['男肺活量分数']=np.NaN\n",
    "for i in range(len(boys_grades)):\n",
    "    if boys_grades['男肺活量'][i]>=standard[('男肺活量','成绩')].iloc[0]:\n",
    "        boys_grades['男肺活量分数'].iloc[i]=100\n",
    "    elif boys_grades['男肺活量'][i]<=standard[('男肺活量','成绩')].iloc[19]:\n",
    "        boys_grades['男肺活量分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if boys_grades['男肺活量'][i] >= standard[('男肺活量','成绩')].iloc[j]:\n",
    "                boys_grades['男肺活量分数'].iloc[i]=standard[('男肺活量','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "#BMI\n",
    "boys_grades.eval('BMI=体重/((身高/100)**2)',inplace=True)\n",
    "boys_grades['BMI']=boys_grades['BMI'].fillna(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "index=[0,1,2,11,3,12,4,13,5,14,6,15,7,16,8,9,10]\n",
    "boys_grades = boys_grades.T.take(index).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>男1000米跑</th>\n",
       "      <th>男1000米跑分数</th>\n",
       "      <th>男50米跑</th>\n",
       "      <th>男50米跑分数</th>\n",
       "      <th>男跳远</th>\n",
       "      <th>男跳远分数</th>\n",
       "      <th>男体前屈</th>\n",
       "      <th>男体前屈分数</th>\n",
       "      <th>男引体</th>\n",
       "      <th>男引体分数</th>\n",
       "      <th>男肺活量</th>\n",
       "      <th>男肺活量分数</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.13</td>\n",
       "      <td>72</td>\n",
       "      <td>8.88</td>\n",
       "      <td>66</td>\n",
       "      <td>195</td>\n",
       "      <td>60</td>\n",
       "      <td>12</td>\n",
       "      <td>74</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2785</td>\n",
       "      <td>62</td>\n",
       "      <td>170</td>\n",
       "      <td>72.6</td>\n",
       "      <td>25.1211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.16</td>\n",
       "      <td>70</td>\n",
       "      <td>7.7</td>\n",
       "      <td>78</td>\n",
       "      <td>225</td>\n",
       "      <td>74</td>\n",
       "      <td>11</td>\n",
       "      <td>74</td>\n",
       "      <td>7</td>\n",
       "      <td>60</td>\n",
       "      <td>3133</td>\n",
       "      <td>68</td>\n",
       "      <td>174</td>\n",
       "      <td>52.7</td>\n",
       "      <td>17.4065</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.09</td>\n",
       "      <td>74</td>\n",
       "      <td>8.45</td>\n",
       "      <td>70</td>\n",
       "      <td>218</td>\n",
       "      <td>70</td>\n",
       "      <td>14</td>\n",
       "      <td>78</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3901</td>\n",
       "      <td>80</td>\n",
       "      <td>169</td>\n",
       "      <td>46.5</td>\n",
       "      <td>16.2809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>4.21</td>\n",
       "      <td>68</td>\n",
       "      <td>8.05</td>\n",
       "      <td>74</td>\n",
       "      <td>206</td>\n",
       "      <td>64</td>\n",
       "      <td>13</td>\n",
       "      <td>76</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>4946</td>\n",
       "      <td>100</td>\n",
       "      <td>183</td>\n",
       "      <td>79.7</td>\n",
       "      <td>23.7989</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>男</td>\n",
       "      <td>3.44</td>\n",
       "      <td>85</td>\n",
       "      <td>7.52</td>\n",
       "      <td>78</td>\n",
       "      <td>210</td>\n",
       "      <td>66</td>\n",
       "      <td>13</td>\n",
       "      <td>76</td>\n",
       "      <td>9</td>\n",
       "      <td>68</td>\n",
       "      <td>3538</td>\n",
       "      <td>74</td>\n",
       "      <td>171</td>\n",
       "      <td>54.7</td>\n",
       "      <td>18.7066</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>472</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.23</td>\n",
       "      <td>68</td>\n",
       "      <td>8.27</td>\n",
       "      <td>72</td>\n",
       "      <td>208</td>\n",
       "      <td>66</td>\n",
       "      <td>10</td>\n",
       "      <td>72</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>4647</td>\n",
       "      <td>100</td>\n",
       "      <td>176</td>\n",
       "      <td>69.5</td>\n",
       "      <td>22.4367</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>473</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>5.19</td>\n",
       "      <td>40</td>\n",
       "      <td>9.55</td>\n",
       "      <td>50</td>\n",
       "      <td>210</td>\n",
       "      <td>66</td>\n",
       "      <td>15</td>\n",
       "      <td>80</td>\n",
       "      <td>6</td>\n",
       "      <td>50</td>\n",
       "      <td>7042</td>\n",
       "      <td>100</td>\n",
       "      <td>177</td>\n",
       "      <td>76</td>\n",
       "      <td>24.2587</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>474</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>3.25</td>\n",
       "      <td>100</td>\n",
       "      <td>7.5</td>\n",
       "      <td>80</td>\n",
       "      <td>252</td>\n",
       "      <td>90</td>\n",
       "      <td>13</td>\n",
       "      <td>76</td>\n",
       "      <td>13</td>\n",
       "      <td>85</td>\n",
       "      <td>5755</td>\n",
       "      <td>100</td>\n",
       "      <td>181</td>\n",
       "      <td>65</td>\n",
       "      <td>19.8407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>475</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>4.39</td>\n",
       "      <td>62</td>\n",
       "      <td>7.81</td>\n",
       "      <td>76</td>\n",
       "      <td>208</td>\n",
       "      <td>66</td>\n",
       "      <td>14</td>\n",
       "      <td>78</td>\n",
       "      <td>11</td>\n",
       "      <td>76</td>\n",
       "      <td>5688</td>\n",
       "      <td>100</td>\n",
       "      <td>172</td>\n",
       "      <td>51.7</td>\n",
       "      <td>17.4757</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>476</td>\n",
       "      <td>17</td>\n",
       "      <td>男</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>50</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>477 rows × 17 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     班级 性别 男1000米跑 男1000米跑分数 男50米跑 男50米跑分数  男跳远 男跳远分数 男体前屈 男体前屈分数 男引体 男引体分数  \\\n",
       "0     1  男    4.13        72  8.88      66  195    60   12     74   1     0   \n",
       "1     1  男    4.16        70   7.7      78  225    74   11     74   7    60   \n",
       "2     1  男    4.09        74  8.45      70  218    70   14     78   1     0   \n",
       "3     1  男    4.21        68  8.05      74  206    64   13     76   1     0   \n",
       "4     1  男    3.44        85  7.52      78  210    66   13     76   9    68   \n",
       "..   .. ..     ...       ...   ...     ...  ...   ...  ...    ...  ..   ...   \n",
       "472  17  男    4.23        68  8.27      72  208    66   10     72   0     0   \n",
       "473  17  男    5.19        40  9.55      50  210    66   15     80   6    50   \n",
       "474  17  男    3.25       100   7.5      80  252    90   13     76  13    85   \n",
       "475  17  男    4.39        62  7.81      76  208    66   14     78  11    76   \n",
       "476  17  男       0         0     0       0    0     0    0     50   0     0   \n",
       "\n",
       "     男肺活量 男肺活量分数   身高    体重      BMI  \n",
       "0    2785     62  170  72.6  25.1211  \n",
       "1    3133     68  174  52.7  17.4065  \n",
       "2    3901     80  169  46.5  16.2809  \n",
       "3    4946    100  183  79.7  23.7989  \n",
       "4    3538     74  171  54.7  18.7066  \n",
       "..    ...    ...  ...   ...      ...  \n",
       "472  4647    100  176  69.5  22.4367  \n",
       "473  7042    100  177    76  24.2587  \n",
       "474  5755    100  181    65  19.8407  \n",
       "475  5688    100  172  51.7  17.4757  \n",
       "476     0      0    0     0        0  \n",
       "\n",
       "[477 rows x 17 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "boys_grades"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "scrolled": true
   },
   "source": [
    "## 女生体测成绩计算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\pandas\\core\\indexing.py:205: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  self._setitem_with_indexer(indexer, value)\n"
     ]
    }
   ],
   "source": [
    "girls_grades['女800米跑分数']=np.NaN\n",
    "for i in range(len(girls_grades)):\n",
    "    if girls_grades['女800米跑'][i] <= 0 * standard[('女800米跑','成绩')].iloc[0]:\n",
    "        girls_grades['女800米跑分数'].iloc[i] = 0\n",
    "    elif girls_grades['女800米跑'][i]<=standard[('女800米跑','成绩')].iloc[0]:\n",
    "        girls_grades['女800米跑分数'].iloc[i]=100\n",
    "    elif girls_grades['女800米跑'][i]>=standard[('女800米跑','成绩')].iloc[19]:\n",
    "        girls_grades['女800米跑分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if girls_grades['女800米跑'][i]<=standard[('女800米跑','成绩')].iloc[j]:\n",
    "                girls_grades['女800米跑分数'].iloc[i]=standard[('女800米跑','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "#女50米跑\n",
    "girls_grades['女50米跑分数']=np.NaN\n",
    "for i in range(len(girls_grades)):\n",
    "    if girls_grades['女50米跑'][i] <= 0 * standard[('女50米跑','成绩')].iloc[0]:\n",
    "        girls_grades['女50米跑分数'].iloc[i] = 0\n",
    "    elif girls_grades['女50米跑'][i]<=standard[('女50米跑','成绩')].iloc[0]:\n",
    "        girls_grades['女50米跑分数'].iloc[i]=100\n",
    "    elif girls_grades['女50米跑'][i]>=standard[('女50米跑','成绩')].iloc[19]:\n",
    "        girls_grades['女50米跑分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if girls_grades['女50米跑'][i]<=standard[('女50米跑','成绩')].iloc[j]:\n",
    "                girls_grades['女50米跑分数'].iloc[i]=standard[('女50米跑','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "#女跳远\n",
    "girls_grades['女跳远分数']=np.NaN\n",
    "for i in range(len(girls_grades)):\n",
    "    if girls_grades['女跳远'][i]>=standard[('女跳远','成绩')].iloc[0]:\n",
    "        girls_grades['女跳远分数'].iloc[i]=100\n",
    "    elif girls_grades['女跳远'][i]<=standard[('女跳远','成绩')].iloc[19]:\n",
    "        girls_grades['女跳远分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if girls_grades['女跳远'][i] >= standard[('女跳远','成绩')].iloc[j]:\n",
    "                girls_grades['女跳远分数'].iloc[i]=standard[('女跳远','分数')].iloc[j]\n",
    "                break\n",
    "            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "#女体前屈\n",
    "girls_grades['女体前屈分数']=np.NaN\n",
    "for i in range(len(girls_grades)):\n",
    "    if girls_grades['女体前屈'][i]>=standard[('女体前屈','成绩')].iloc[0]:\n",
    "        girls_grades['女体前屈分数'].iloc[i]=100\n",
    "    elif girls_grades['女体前屈'][i]<=standard[('女体前屈','成绩')].iloc[19]:\n",
    "        girls_grades['女体前屈分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if girls_grades['女体前屈'][i] >= standard[('女体前屈','成绩')].iloc[j]:\n",
    "                girls_grades['女体前屈分数'].iloc[i]=standard[('女体前屈','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "#女仰卧\n",
    "girls_grades['女仰卧分数']=np.NaN\n",
    "for i in range(len(girls_grades)):\n",
    "    if girls_grades['女仰卧'][i]>=standard[('女仰卧','成绩')].iloc[0]:\n",
    "        girls_grades['女仰卧分数'].iloc[i]=100\n",
    "    elif girls_grades['女仰卧'][i]<=standard[('女仰卧','成绩')].iloc[19]:\n",
    "        girls_grades['女仰卧分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if girls_grades['女仰卧'][i] >= standard[('女仰卧','成绩')].iloc[j]:\n",
    "                girls_grades['女仰卧分数'].iloc[i]=standard[('女仰卧','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "#女肺活量\n",
    "girls_grades['女肺活量分数']=np.NaN\n",
    "for i in range(len(girls_grades)):\n",
    "    if girls_grades['女肺活量'][i]>=standard[('女肺活量','成绩')].iloc[0]:\n",
    "        girls_grades['女肺活量分数'].iloc[i]=100\n",
    "    elif girls_grades['女肺活量'][i]<=standard[('女肺活量','成绩')].iloc[19]:\n",
    "        girls_grades['女肺活量分数'].iloc[i]=0\n",
    "    else:\n",
    "        for j in range(1,20):\n",
    "            if girls_grades['女肺活量'][i] >= standard[('女肺活量','成绩')].iloc[j]:\n",
    "                girls_grades['女肺活量分数'].iloc[i]=standard[('女肺活量','分数')].iloc[j]\n",
    "                break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "#BMI\n",
    "girls_grades.eval('BMI=体重/((身高/100)**2)',inplace=True)\n",
    "girls_grades['BMI']=girls_grades['BMI'].fillna(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "girls_grades = girls_grades.T.take(index).T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>班级</th>\n",
       "      <th>性别</th>\n",
       "      <th>女800米跑</th>\n",
       "      <th>女800米跑分数</th>\n",
       "      <th>女50米跑</th>\n",
       "      <th>女50米跑分数</th>\n",
       "      <th>女跳远</th>\n",
       "      <th>女跳远分数</th>\n",
       "      <th>女体前屈</th>\n",
       "      <th>女体前屈分数</th>\n",
       "      <th>女仰卧</th>\n",
       "      <th>女仰卧分数</th>\n",
       "      <th>女肺活量</th>\n",
       "      <th>女肺活量分数</th>\n",
       "      <th>身高</th>\n",
       "      <th>体重</th>\n",
       "      <th>BMI</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.22</td>\n",
       "      <td>100</td>\n",
       "      <td>9.32</td>\n",
       "      <td>72</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>16</td>\n",
       "      <td>76</td>\n",
       "      <td>48</td>\n",
       "      <td>85</td>\n",
       "      <td>3775</td>\n",
       "      <td>100</td>\n",
       "      <td>163</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.3082</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.59</td>\n",
       "      <td>40</td>\n",
       "      <td>11.44</td>\n",
       "      <td>10</td>\n",
       "      <td>148</td>\n",
       "      <td>60</td>\n",
       "      <td>9</td>\n",
       "      <td>66</td>\n",
       "      <td>29</td>\n",
       "      <td>66</td>\n",
       "      <td>3683</td>\n",
       "      <td>100</td>\n",
       "      <td>163</td>\n",
       "      <td>66.6</td>\n",
       "      <td>25.0668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.46</td>\n",
       "      <td>80</td>\n",
       "      <td>13.4</td>\n",
       "      <td>0</td>\n",
       "      <td>150</td>\n",
       "      <td>60</td>\n",
       "      <td>7</td>\n",
       "      <td>64</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>3331</td>\n",
       "      <td>100</td>\n",
       "      <td>157</td>\n",
       "      <td>60</td>\n",
       "      <td>24.3418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.39</td>\n",
       "      <td>85</td>\n",
       "      <td>9.52</td>\n",
       "      <td>70</td>\n",
       "      <td>172</td>\n",
       "      <td>76</td>\n",
       "      <td>21</td>\n",
       "      <td>90</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3701</td>\n",
       "      <td>100</td>\n",
       "      <td>160</td>\n",
       "      <td>50.7</td>\n",
       "      <td>19.8047</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.43</td>\n",
       "      <td>85</td>\n",
       "      <td>9.79</td>\n",
       "      <td>68</td>\n",
       "      <td>145</td>\n",
       "      <td>50</td>\n",
       "      <td>8</td>\n",
       "      <td>64</td>\n",
       "      <td>34</td>\n",
       "      <td>70</td>\n",
       "      <td>3592</td>\n",
       "      <td>100</td>\n",
       "      <td>167</td>\n",
       "      <td>63.9</td>\n",
       "      <td>22.9123</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.47</td>\n",
       "      <td>80</td>\n",
       "      <td>10.01</td>\n",
       "      <td>64</td>\n",
       "      <td>158</td>\n",
       "      <td>66</td>\n",
       "      <td>17</td>\n",
       "      <td>78</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>3483</td>\n",
       "      <td>100</td>\n",
       "      <td>170</td>\n",
       "      <td>47</td>\n",
       "      <td>16.263</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.69</td>\n",
       "      <td>40</td>\n",
       "      <td>10.42</td>\n",
       "      <td>60</td>\n",
       "      <td>150</td>\n",
       "      <td>60</td>\n",
       "      <td>18</td>\n",
       "      <td>80</td>\n",
       "      <td>32</td>\n",
       "      <td>68</td>\n",
       "      <td>3754</td>\n",
       "      <td>100</td>\n",
       "      <td>158</td>\n",
       "      <td>54</td>\n",
       "      <td>21.6311</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.26</td>\n",
       "      <td>64</td>\n",
       "      <td>10.03</td>\n",
       "      <td>64</td>\n",
       "      <td>165</td>\n",
       "      <td>70</td>\n",
       "      <td>16</td>\n",
       "      <td>76</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>4520</td>\n",
       "      <td>100</td>\n",
       "      <td>160</td>\n",
       "      <td>48.5</td>\n",
       "      <td>18.9453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.48</td>\n",
       "      <td>80</td>\n",
       "      <td>10.59</td>\n",
       "      <td>60</td>\n",
       "      <td>159</td>\n",
       "      <td>66</td>\n",
       "      <td>8</td>\n",
       "      <td>64</td>\n",
       "      <td>46</td>\n",
       "      <td>85</td>\n",
       "      <td>3662</td>\n",
       "      <td>100</td>\n",
       "      <td>160</td>\n",
       "      <td>42</td>\n",
       "      <td>16.4062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.18</td>\n",
       "      <td>68</td>\n",
       "      <td>10.3</td>\n",
       "      <td>62</td>\n",
       "      <td>161</td>\n",
       "      <td>68</td>\n",
       "      <td>22</td>\n",
       "      <td>90</td>\n",
       "      <td>42</td>\n",
       "      <td>78</td>\n",
       "      <td>3955</td>\n",
       "      <td>100</td>\n",
       "      <td>171</td>\n",
       "      <td>62.2</td>\n",
       "      <td>21.2715</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>10</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.38</td>\n",
       "      <td>85</td>\n",
       "      <td>9.37</td>\n",
       "      <td>72</td>\n",
       "      <td>162</td>\n",
       "      <td>68</td>\n",
       "      <td>15</td>\n",
       "      <td>76</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>4374</td>\n",
       "      <td>100</td>\n",
       "      <td>157</td>\n",
       "      <td>56</td>\n",
       "      <td>22.719</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>11</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.11</td>\n",
       "      <td>70</td>\n",
       "      <td>10.68</td>\n",
       "      <td>50</td>\n",
       "      <td>150</td>\n",
       "      <td>60</td>\n",
       "      <td>15</td>\n",
       "      <td>76</td>\n",
       "      <td>45</td>\n",
       "      <td>80</td>\n",
       "      <td>4488</td>\n",
       "      <td>100</td>\n",
       "      <td>175</td>\n",
       "      <td>53.2</td>\n",
       "      <td>17.3714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>12</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>80</td>\n",
       "      <td>9.74</td>\n",
       "      <td>68</td>\n",
       "      <td>168</td>\n",
       "      <td>72</td>\n",
       "      <td>21</td>\n",
       "      <td>90</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>4176</td>\n",
       "      <td>100</td>\n",
       "      <td>164</td>\n",
       "      <td>49.5</td>\n",
       "      <td>18.4042</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>13</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.59</td>\n",
       "      <td>76</td>\n",
       "      <td>10.83</td>\n",
       "      <td>40</td>\n",
       "      <td>140</td>\n",
       "      <td>40</td>\n",
       "      <td>6</td>\n",
       "      <td>62</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>3497</td>\n",
       "      <td>100</td>\n",
       "      <td>159</td>\n",
       "      <td>52</td>\n",
       "      <td>20.5688</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>14</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.32</td>\n",
       "      <td>90</td>\n",
       "      <td>10.25</td>\n",
       "      <td>62</td>\n",
       "      <td>167</td>\n",
       "      <td>72</td>\n",
       "      <td>19</td>\n",
       "      <td>80</td>\n",
       "      <td>31</td>\n",
       "      <td>68</td>\n",
       "      <td>4094</td>\n",
       "      <td>100</td>\n",
       "      <td>165</td>\n",
       "      <td>56.7</td>\n",
       "      <td>20.8264</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>15</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.4</td>\n",
       "      <td>85</td>\n",
       "      <td>10.25</td>\n",
       "      <td>62</td>\n",
       "      <td>152</td>\n",
       "      <td>62</td>\n",
       "      <td>21</td>\n",
       "      <td>90</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3403</td>\n",
       "      <td>100</td>\n",
       "      <td>156</td>\n",
       "      <td>50.9</td>\n",
       "      <td>20.9155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>16</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.58</td>\n",
       "      <td>76</td>\n",
       "      <td>9.85</td>\n",
       "      <td>66</td>\n",
       "      <td>160</td>\n",
       "      <td>68</td>\n",
       "      <td>14</td>\n",
       "      <td>74</td>\n",
       "      <td>29</td>\n",
       "      <td>66</td>\n",
       "      <td>4433</td>\n",
       "      <td>100</td>\n",
       "      <td>172</td>\n",
       "      <td>77.6</td>\n",
       "      <td>26.2304</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>17</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.36</td>\n",
       "      <td>90</td>\n",
       "      <td>9.41</td>\n",
       "      <td>70</td>\n",
       "      <td>182</td>\n",
       "      <td>80</td>\n",
       "      <td>24</td>\n",
       "      <td>95</td>\n",
       "      <td>30</td>\n",
       "      <td>66</td>\n",
       "      <td>4520</td>\n",
       "      <td>100</td>\n",
       "      <td>167</td>\n",
       "      <td>61.6</td>\n",
       "      <td>22.0876</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.48</td>\n",
       "      <td>80</td>\n",
       "      <td>9.44</td>\n",
       "      <td>70</td>\n",
       "      <td>176</td>\n",
       "      <td>78</td>\n",
       "      <td>17</td>\n",
       "      <td>78</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>4209</td>\n",
       "      <td>100</td>\n",
       "      <td>157</td>\n",
       "      <td>57.1</td>\n",
       "      <td>23.1652</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>19</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.24</td>\n",
       "      <td>100</td>\n",
       "      <td>9.07</td>\n",
       "      <td>74</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>22</td>\n",
       "      <td>90</td>\n",
       "      <td>33</td>\n",
       "      <td>70</td>\n",
       "      <td>2887</td>\n",
       "      <td>80</td>\n",
       "      <td>167</td>\n",
       "      <td>52</td>\n",
       "      <td>18.6453</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>20</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.48</td>\n",
       "      <td>80</td>\n",
       "      <td>10</td>\n",
       "      <td>66</td>\n",
       "      <td>160</td>\n",
       "      <td>68</td>\n",
       "      <td>18</td>\n",
       "      <td>80</td>\n",
       "      <td>30</td>\n",
       "      <td>66</td>\n",
       "      <td>3016</td>\n",
       "      <td>85</td>\n",
       "      <td>157</td>\n",
       "      <td>55.7</td>\n",
       "      <td>22.5973</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>21</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.09</td>\n",
       "      <td>72</td>\n",
       "      <td>10</td>\n",
       "      <td>66</td>\n",
       "      <td>172</td>\n",
       "      <td>76</td>\n",
       "      <td>8</td>\n",
       "      <td>64</td>\n",
       "      <td>42</td>\n",
       "      <td>78</td>\n",
       "      <td>3949</td>\n",
       "      <td>100</td>\n",
       "      <td>172</td>\n",
       "      <td>57.8</td>\n",
       "      <td>19.5376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>22</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.3</td>\n",
       "      <td>95</td>\n",
       "      <td>9.74</td>\n",
       "      <td>68</td>\n",
       "      <td>155</td>\n",
       "      <td>64</td>\n",
       "      <td>10</td>\n",
       "      <td>68</td>\n",
       "      <td>35</td>\n",
       "      <td>72</td>\n",
       "      <td>3574</td>\n",
       "      <td>100</td>\n",
       "      <td>155</td>\n",
       "      <td>52.2</td>\n",
       "      <td>21.7274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>23</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.35</td>\n",
       "      <td>90</td>\n",
       "      <td>9.74</td>\n",
       "      <td>68</td>\n",
       "      <td>180</td>\n",
       "      <td>80</td>\n",
       "      <td>19</td>\n",
       "      <td>80</td>\n",
       "      <td>33</td>\n",
       "      <td>70</td>\n",
       "      <td>3285</td>\n",
       "      <td>100</td>\n",
       "      <td>161</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.7909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>24</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>4.03</td>\n",
       "      <td>74</td>\n",
       "      <td>10.8</td>\n",
       "      <td>50</td>\n",
       "      <td>151</td>\n",
       "      <td>62</td>\n",
       "      <td>11</td>\n",
       "      <td>70</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>3503</td>\n",
       "      <td>100</td>\n",
       "      <td>162</td>\n",
       "      <td>50.6</td>\n",
       "      <td>19.2806</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>25</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.4</td>\n",
       "      <td>85</td>\n",
       "      <td>9.95</td>\n",
       "      <td>66</td>\n",
       "      <td>168</td>\n",
       "      <td>72</td>\n",
       "      <td>15</td>\n",
       "      <td>76</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>4586</td>\n",
       "      <td>100</td>\n",
       "      <td>166</td>\n",
       "      <td>53.3</td>\n",
       "      <td>19.3424</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>26</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.58</td>\n",
       "      <td>76</td>\n",
       "      <td>9.68</td>\n",
       "      <td>68</td>\n",
       "      <td>186</td>\n",
       "      <td>85</td>\n",
       "      <td>21</td>\n",
       "      <td>90</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>3942</td>\n",
       "      <td>100</td>\n",
       "      <td>161</td>\n",
       "      <td>51.3</td>\n",
       "      <td>19.7909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>27</td>\n",
       "      <td>1</td>\n",
       "      <td>女</td>\n",
       "      <td>3.49</td>\n",
       "      <td>80</td>\n",
       "      <td>8.77</td>\n",
       "      <td>78</td>\n",
       "      <td>185</td>\n",
       "      <td>85</td>\n",
       "      <td>19</td>\n",
       "      <td>80</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>3171</td>\n",
       "      <td>100</td>\n",
       "      <td>160</td>\n",
       "      <td>46.7</td>\n",
       "      <td>18.2422</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>28</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>10.1</td>\n",
       "      <td>64</td>\n",
       "      <td>150</td>\n",
       "      <td>60</td>\n",
       "      <td>30</td>\n",
       "      <td>100</td>\n",
       "      <td>28</td>\n",
       "      <td>64</td>\n",
       "      <td>2673</td>\n",
       "      <td>78</td>\n",
       "      <td>169</td>\n",
       "      <td>61</td>\n",
       "      <td>21.3578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>29</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>4.19</td>\n",
       "      <td>68</td>\n",
       "      <td>9.9</td>\n",
       "      <td>66</td>\n",
       "      <td>151</td>\n",
       "      <td>62</td>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>32</td>\n",
       "      <td>68</td>\n",
       "      <td>3410</td>\n",
       "      <td>100</td>\n",
       "      <td>165</td>\n",
       "      <td>65.6</td>\n",
       "      <td>24.0955</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>30</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>4.1</td>\n",
       "      <td>72</td>\n",
       "      <td>9.86</td>\n",
       "      <td>66</td>\n",
       "      <td>160</td>\n",
       "      <td>68</td>\n",
       "      <td>20</td>\n",
       "      <td>85</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>1849</td>\n",
       "      <td>60</td>\n",
       "      <td>163</td>\n",
       "      <td>59.7</td>\n",
       "      <td>22.4698</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>31</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>4.12</td>\n",
       "      <td>70</td>\n",
       "      <td>9.99</td>\n",
       "      <td>66</td>\n",
       "      <td>150</td>\n",
       "      <td>60</td>\n",
       "      <td>21</td>\n",
       "      <td>90</td>\n",
       "      <td>43</td>\n",
       "      <td>80</td>\n",
       "      <td>3122</td>\n",
       "      <td>95</td>\n",
       "      <td>159</td>\n",
       "      <td>62.4</td>\n",
       "      <td>24.6826</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>32</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>3.29</td>\n",
       "      <td>95</td>\n",
       "      <td>9.33</td>\n",
       "      <td>72</td>\n",
       "      <td>155</td>\n",
       "      <td>64</td>\n",
       "      <td>8</td>\n",
       "      <td>64</td>\n",
       "      <td>38</td>\n",
       "      <td>74</td>\n",
       "      <td>2369</td>\n",
       "      <td>72</td>\n",
       "      <td>155</td>\n",
       "      <td>48.3</td>\n",
       "      <td>20.1041</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>33</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>4.16</td>\n",
       "      <td>68</td>\n",
       "      <td>9.66</td>\n",
       "      <td>68</td>\n",
       "      <td>140</td>\n",
       "      <td>40</td>\n",
       "      <td>11</td>\n",
       "      <td>70</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>2712</td>\n",
       "      <td>78</td>\n",
       "      <td>169</td>\n",
       "      <td>49.3</td>\n",
       "      <td>17.2613</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>34</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>4.15</td>\n",
       "      <td>70</td>\n",
       "      <td>10.27</td>\n",
       "      <td>62</td>\n",
       "      <td>150</td>\n",
       "      <td>60</td>\n",
       "      <td>15</td>\n",
       "      <td>76</td>\n",
       "      <td>41</td>\n",
       "      <td>78</td>\n",
       "      <td>2308</td>\n",
       "      <td>70</td>\n",
       "      <td>162</td>\n",
       "      <td>52.4</td>\n",
       "      <td>19.9665</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>35</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>3.55</td>\n",
       "      <td>78</td>\n",
       "      <td>9.59</td>\n",
       "      <td>70</td>\n",
       "      <td>175</td>\n",
       "      <td>78</td>\n",
       "      <td>30</td>\n",
       "      <td>100</td>\n",
       "      <td>31</td>\n",
       "      <td>68</td>\n",
       "      <td>3166</td>\n",
       "      <td>100</td>\n",
       "      <td>166</td>\n",
       "      <td>47.5</td>\n",
       "      <td>17.2376</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>36</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>3.51</td>\n",
       "      <td>78</td>\n",
       "      <td>9.54</td>\n",
       "      <td>70</td>\n",
       "      <td>150</td>\n",
       "      <td>60</td>\n",
       "      <td>11</td>\n",
       "      <td>70</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>3187</td>\n",
       "      <td>100</td>\n",
       "      <td>169</td>\n",
       "      <td>56.6</td>\n",
       "      <td>19.8172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>37</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>3.32</td>\n",
       "      <td>90</td>\n",
       "      <td>8.71</td>\n",
       "      <td>78</td>\n",
       "      <td>181</td>\n",
       "      <td>80</td>\n",
       "      <td>13</td>\n",
       "      <td>72</td>\n",
       "      <td>37</td>\n",
       "      <td>74</td>\n",
       "      <td>2669</td>\n",
       "      <td>78</td>\n",
       "      <td>167</td>\n",
       "      <td>50</td>\n",
       "      <td>17.9282</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>38</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>3.45</td>\n",
       "      <td>80</td>\n",
       "      <td>9.05</td>\n",
       "      <td>74</td>\n",
       "      <td>152</td>\n",
       "      <td>62</td>\n",
       "      <td>18</td>\n",
       "      <td>80</td>\n",
       "      <td>40</td>\n",
       "      <td>76</td>\n",
       "      <td>3122</td>\n",
       "      <td>95</td>\n",
       "      <td>160</td>\n",
       "      <td>61.2</td>\n",
       "      <td>23.9062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>39</td>\n",
       "      <td>2</td>\n",
       "      <td>女</td>\n",
       "      <td>3.48</td>\n",
       "      <td>80</td>\n",
       "      <td>8.7</td>\n",
       "      <td>78</td>\n",
       "      <td>210</td>\n",
       "      <td>100</td>\n",
       "      <td>18</td>\n",
       "      <td>80</td>\n",
       "      <td>49</td>\n",
       "      <td>90</td>\n",
       "      <td>2928</td>\n",
       "      <td>85</td>\n",
       "      <td>163</td>\n",
       "      <td>50</td>\n",
       "      <td>18.8189</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   班级 性别 女800米跑 女800米跑分数  女50米跑 女50米跑分数  女跳远 女跳远分数 女体前屈 女体前屈分数 女仰卧 女仰卧分数  \\\n",
       "0   1  女   3.22      100   9.32      72  185    85   16     76  48    85   \n",
       "1   1  女   4.59       40  11.44      10  148    60    9     66  29    66   \n",
       "2   1  女   3.46       80   13.4       0  150    60    7     64  40    76   \n",
       "3   1  女   3.39       85   9.52      70  172    76   21     90  46    85   \n",
       "4   1  女   3.43       85   9.79      68  145    50    8     64  34    70   \n",
       "5   1  女   3.47       80  10.01      64  158    66   17     78  35    72   \n",
       "6   1  女   4.69       40  10.42      60  150    60   18     80  32    68   \n",
       "7   1  女   4.26       64  10.03      64  165    70   16     76  35    72   \n",
       "8   1  女   3.48       80  10.59      60  159    66    8     64  46    85   \n",
       "9   1  女   4.18       68   10.3      62  161    68   22     90  42    78   \n",
       "10  1  女   3.38       85   9.37      72  162    68   15     76  43    80   \n",
       "11  1  女   4.11       70  10.68      50  150    60   15     76  45    80   \n",
       "12  1  女   3.45       80   9.74      68  168    72   21     90  35    72   \n",
       "13  1  女   3.59       76  10.83      40  140    40    6     62  41    78   \n",
       "14  1  女   3.32       90  10.25      62  167    72   19     80  31    68   \n",
       "15  1  女    3.4       85  10.25      62  152    62   21     90  43    80   \n",
       "16  1  女   3.58       76   9.85      66  160    68   14     74  29    66   \n",
       "17  1  女   3.36       90   9.41      70  182    80   24     95  30    66   \n",
       "18  1  女   3.48       80   9.44      70  176    78   17     78  43    80   \n",
       "19  1  女   3.24      100   9.07      74  185    85   22     90  33    70   \n",
       "20  1  女   3.48       80     10      66  160    68   18     80  30    66   \n",
       "21  1  女   4.09       72     10      66  172    76    8     64  42    78   \n",
       "22  1  女    3.3       95   9.74      68  155    64   10     68  35    72   \n",
       "23  1  女   3.35       90   9.74      68  180    80   19     80  33    70   \n",
       "24  1  女   4.03       74   10.8      50  151    62   11     70  40    76   \n",
       "25  1  女    3.4       85   9.95      66  168    72   15     76  41    78   \n",
       "26  1  女   3.58       76   9.68      68  186    85   21     90  40    76   \n",
       "27  1  女   3.49       80   8.77      78  185    85   19     80  40    76   \n",
       "28  2  女      0        0   10.1      64  150    60   30    100  28    64   \n",
       "29  2  女   4.19       68    9.9      66  151    62   20     85  32    68   \n",
       "30  2  女    4.1       72   9.86      66  160    68   20     85  43    80   \n",
       "31  2  女   4.12       70   9.99      66  150    60   21     90  43    80   \n",
       "32  2  女   3.29       95   9.33      72  155    64    8     64  38    74   \n",
       "33  2  女   4.16       68   9.66      68  140    40   11     70  40    76   \n",
       "34  2  女   4.15       70  10.27      62  150    60   15     76  41    78   \n",
       "35  2  女   3.55       78   9.59      70  175    78   30    100  31    68   \n",
       "36  2  女   3.51       78   9.54      70  150    60   11     70  40    76   \n",
       "37  2  女   3.32       90   8.71      78  181    80   13     72  37    74   \n",
       "38  2  女   3.45       80   9.05      74  152    62   18     80  40    76   \n",
       "39  2  女   3.48       80    8.7      78  210   100   18     80  49    90   \n",
       "\n",
       "    女肺活量 女肺活量分数   身高    体重      BMI  \n",
       "0   3775    100  163  51.3  19.3082  \n",
       "1   3683    100  163  66.6  25.0668  \n",
       "2   3331    100  157    60  24.3418  \n",
       "3   3701    100  160  50.7  19.8047  \n",
       "4   3592    100  167  63.9  22.9123  \n",
       "5   3483    100  170    47   16.263  \n",
       "6   3754    100  158    54  21.6311  \n",
       "7   4520    100  160  48.5  18.9453  \n",
       "8   3662    100  160    42  16.4062  \n",
       "9   3955    100  171  62.2  21.2715  \n",
       "10  4374    100  157    56   22.719  \n",
       "11  4488    100  175  53.2  17.3714  \n",
       "12  4176    100  164  49.5  18.4042  \n",
       "13  3497    100  159    52  20.5688  \n",
       "14  4094    100  165  56.7  20.8264  \n",
       "15  3403    100  156  50.9  20.9155  \n",
       "16  4433    100  172  77.6  26.2304  \n",
       "17  4520    100  167  61.6  22.0876  \n",
       "18  4209    100  157  57.1  23.1652  \n",
       "19  2887     80  167    52  18.6453  \n",
       "20  3016     85  157  55.7  22.5973  \n",
       "21  3949    100  172  57.8  19.5376  \n",
       "22  3574    100  155  52.2  21.7274  \n",
       "23  3285    100  161  51.3  19.7909  \n",
       "24  3503    100  162  50.6  19.2806  \n",
       "25  4586    100  166  53.3  19.3424  \n",
       "26  3942    100  161  51.3  19.7909  \n",
       "27  3171    100  160  46.7  18.2422  \n",
       "28  2673     78  169    61  21.3578  \n",
       "29  3410    100  165  65.6  24.0955  \n",
       "30  1849     60  163  59.7  22.4698  \n",
       "31  3122     95  159  62.4  24.6826  \n",
       "32  2369     72  155  48.3  20.1041  \n",
       "33  2712     78  169  49.3  17.2613  \n",
       "34  2308     70  162  52.4  19.9665  \n",
       "35  3166    100  166  47.5  17.2376  \n",
       "36  3187    100  169  56.6  19.8172  \n",
       "37  2669     78  167    50  17.9282  \n",
       "38  3122     95  160  61.2  23.9062  \n",
       "39  2928     85  163    50  18.8189  "
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "girls_grades.head(n=40)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
